#ifndef _IniFile_H_
#define _IniFile_H_

#include <Windows.h>
#include <tchar.h>

class IniFile
{
public:
	IniFile();
	~IniFile();

	void Init(TCHAR *ptcFileName);

	void SetAppName(TCHAR *ptcAppName);

	bool WriteString(const TCHAR *ptcKeyName, const TCHAR *value);
	bool WriteStruct(const TCHAR *ptcKeyName, void *pvValue, UINT size);
	bool WriteAll(const TCHAR *ptcValue, UINT size);


	UINT32 ReadString(const TCHAR *ptcKeyName, const TCHAR *ptcDefault, TCHAR *value, UINT size);
	UINT32 ReadStruct(const TCHAR *ptcKeyName, void *pvValue, UINT size);
	UINT32 ReadInt(const TCHAR *ptcKeyName, int nDefault);


	UINT32 ReadAll(TCHAR *value, UINT size);

	UINT32 ReadSectionList(TCHAR *value, UINT size);


protected:
	TCHAR m_ptcFileName[MAX_PATH];
	TCHAR m_ptcAppName[MAX_PATH];
};

#endif	//	_IniFile_H_
